<?php echo $this->fetch('member.header.html'); ?>
<div id="page-buyer-order" class="mb10">
	<div class="buyer-order-body page-body">
		<?php $_from = $this->_var['orders']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'order');if (count($_from)):
    foreach ($_from AS $this->_var['order']):
?>
                <div class="order-form mb10">
                    <h2 class="clearfix">
						 <p class="name"><a href="<?php echo url('app=store&id=' . $this->_var['order']['seller_id']. ''); ?>" ><?php echo htmlspecialchars($this->_var['order']['seller_name']); ?></a></p>
                        <p class="num ml10">订单号: <?php echo $this->_var['order']['order_sn']; ?><?php if ($this->_var['order']['extension'] == 'groupbuy'): ?><span class="color8">[团购]</span><?php endif; ?></p>
                    </h2>

                    <?php $_from = $this->_var['order']['order_goods']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods');$this->_foreach['fe_goods'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['fe_goods']['total'] > 0):
    foreach ($_from AS $this->_var['goods']):
        $this->_foreach['fe_goods']['iteration']++;
?>
                    <div <?php if (! ($this->_foreach['fe_goods']['iteration'] == $this->_foreach['fe_goods']['total'])): ?>style="border-bottom-style:dashed"<?php endif; ?> class="con webkit-box clearfix">
                        <div class="pic"><a href="<?php echo url('app=goods&id=' . $this->_var['goods']['goods_id']. ''); ?>" ><img src="<?php echo $this->_var['goods']['goods_image']; ?>" width="50" height="50"  /></a></div>
                        <div class="txt">
							<a href="<?php echo url('app=buyer_order&act=view&order_id=' . $this->_var['order']['order_id']. ''); ?>">
								<p><?php echo htmlspecialchars($this->_var['goods']['goods_name']); ?></p>
								<?php if ($this->_var['goods']['specification']): ?><span class="attr mt5"><?php echo htmlspecialchars($this->_var['goods']['specification']); ?></span><br /><?php endif; ?>
								 <span class="order-amount mt5">实付:<?php echo price_format($this->_var['order']['order_amount']); ?></span><br />
								<span class="mt5">共 <?php echo $this->_var['goods']['quantity']; ?> 件</span><br />
							</a>
						</div>
                    </div>
                    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                      <p class="status"><em><?php echo call_user_func("order_status",$this->_var['order']['status']); ?><?php if ($this->_var['order']['evaluation_status']): ?>,&nbsp;已评价<?php endif; ?></em></p>
					<div class="operate-btn pt10">
                    
								<a class="btn1 mr5" href="<?php echo url('app=buyer_order&act=evaluate&order_id=' . $this->_var['order']['order_id']. ''); ?>"  id="order<?php echo $this->_var['order']['order_id']; ?>_evaluate" <?php if ($this->_var['order']['status'] != ORDER_FINISHED || $this->_var['order']['evaluation_status'] != 0): ?>style="display:none"<?php endif; ?>>我要评价</a>
								<a href="<?php echo url('app=cashier&order_id=' . $this->_var['order']['order_id']. ''); ?>"  id="order<?php echo $this->_var['order']['order_id']; ?>_action_pay" <?php if ($this->_var['order']['status'] != ORDER_PENDING): ?> style="display:none"<?php endif; ?> class="btn1 mr5">付款</a>
								<a class="btn1 mr5" href="<?php echo url('app=buyer_order&act=confirm_order&order_id=' . $this->_var['order']['order_id']. ''); ?>" <?php if ($this->_var['order']['status'] != ORDER_SHIPPED || $this->_var['order']['payment_code'] == 'cod'): ?> style="display:none"<?php endif; ?>>确认订单</a>
								<a class="btn1 mr5" href="<?php echo url('app=buyer_order&act=cancel_order&order_id=' . $this->_var['order']['order_id']. ''); ?>" <?php if ($this->_var['order']['status'] != ORDER_PENDING && $this->_var['order']['status'] != ORDER_SUBMITTED): ?> style="display:none"<?php endif; ?>>取消订单</a>
                                <a class="btn1 mr5" href="<?php echo url('app=buyer_order&act=view&order_id=' . $this->_var['order']['order_id']. ''); ?>" >查看订单</a>
                                
                                 <?php if ($this->_var['enable_express']): ?>
                        		<a class="btn1" href="<?php echo url('app=order_express&order_id=' . $this->_var['order']['order_id']. ''); ?>" <?php if ($this->_var['order']['status'] != ORDER_SHIPPED && $this->_var['order']['status'] != ORDER_FINISHED): ?> style="display:none"<?php endif; ?>>查看物流</a>
                        	<?php endif; ?>
							</div>
                </div>
                <?php endforeach; else: ?>
                <div class="no-record">
                    <span>没有符合条件的订单</span>
                </div>
                <?php endif; unset($_from); ?><?php $this->pop_vars();; ?> 
	</div>
    <?php if ($this->_var['orders']): ?>
    <?php echo $this->fetch('page.bottom.html'); ?>
    <?php endif; ?>
</div>
<?php echo $this->fetch('footer.html'); ?>
